package com.bdqn.controller;

import com.bdqn.base.R;
import com.bdqn.base.logger.WebLogger;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * HelloController
 *
 * @author LILIBO
 * @since 2023-02-22
 */

@Api(tags = "安全认证测试接口")
@RestController
@RequestMapping("/hello")
public class HelloController {

    @ApiOperation("Hi 认证授权测试接口")
    @WebLogger("Hi 认证授权测试接口")
    @PreAuthorize("hasAuthority('sys')") // 拥有sys权限才能访问
    @GetMapping("/hi")
    public R sayHi()  {
        return R.success("Hi 老王");
    }

}
